{% extends 'base.html' %}

{% block title %}审批申请 - 请假审批系统{% endblock %}

{% block content %}
<div class="card">
    <div class="card-header">
        <h2>审批请假申请</h2>
    </div>
    
    <!-- 申请信息概览 -->
    <div style="background: #f8f9fa; padding: 1.5rem; border-radius: 5px; margin-bottom: 2rem;">
        <h3 style="margin-bottom: 1rem; color: #333;">申请信息</h3>
        <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;">
            <div><strong>申请人：</strong>{{ application.applicant.get_full_name|default:application.applicant.username }}</div>
            <div><strong>请假类型：</strong>{{ application.leave_type.name }}</div>
            <div><strong>请假时间：</strong>{{ application.start_date }} 至 {{ application.end_date }}</div>
            <div><strong>请假天数：</strong>{{ application.days_requested }}天</div>
        </div>
        <div style="margin-top: 1rem;">
            <strong>请假原因：</strong>
            <div style="margin-top: 0.5rem;">{{ application.reason }}</div>
        </div>
    </div>
    
    <form method="post">
        {% csrf_token %}
        
        <div class="form-group">
            <label for="comments">审批意见</label>
            <textarea name="comments" id="comments" rows="4" placeholder="请输入审批意见..."></textarea>
        </div>
        
        <div style="display: flex; gap: 1rem; justify-content: center;">
            <button type="submit" name="action" value="approve" class="btn btn-success">批准</button>
            <button type="submit" name="action" value="reject" class="btn btn-danger">拒绝</button>
            <button type="submit" name="action" value="return" class="btn btn-warning">退回</button>
            <a href="{% url 'leave_detail' application.id %}" class="btn btn-secondary">取消</a>
        </div>
    </form>
</div>
{% endblock %}
